#ifndef FTEXT_H
#define FTEXT_H

#include "text.h"
#include <vector>
#include <map>

class TextFactory
{
public:
	TextFactory();
	Text &  giveText(std::string const & file_name) const;
	
private:
	typedef Text &  (TextFactory::*TextFuncP)() const;
	std::map<std::string, TextFuncP > reserve_extensions;
	
private:
	std::string findExtension(std::string const & file_name) const;
	Text & newTxtText() const;
	Text & newXmlText() const;
};

#endif